package com.fat.thegioivere.fragment;

import android.os.Bundle;
import android.app.Fragment;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

import com.fat.thegioivere.R;
import com.fat.thegioivere.activities.SearchTicketActivity;

public class HomeFragment extends Fragment implements OnClickListener {

	private Button btnVeNoiDia;
	private Button btnVeQuocTe;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.fragment_home, container,
				false);
		findViewIdAll(rootView);
		return rootView;
	}

	private void findViewIdAll(View view) {
		btnVeNoiDia = (Button) view.findViewById(R.id.btnVeNoiDiaHome);
		btnVeQuocTe = (Button) view.findViewById(R.id.btnVeQuocTeHome);

		btnVeNoiDia.setOnClickListener(this);
		btnVeQuocTe.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btnVeNoiDiaHome:
			getActivity().startActivity(
					new Intent(getActivity(), SearchTicketActivity.class));
			break;

		default:
			break;
		}
	}
}
